package com.gaga.demo.web;

import com.gaga.demo.comm.GagaInfo;
import com.gaga.demo.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {

    /*@Value("${com.gaga.name}")
    private String name;
    @Value("${com.gaga.email}")
    private String email;*/

    @Resource
    private GagaInfo gagaInfo;

    @Autowired
    private DemoService demoService;

    @RequestMapping("/hello")
    public String hello(){
        String msg=demoService.sayHello();
        /*msg+=" "+name+" "+email;*/
        msg+=" "+gagaInfo.getName()+" "+gagaInfo.getEmail();
        return msg;
    }
}
